package BehavioralMode.observer.WeChatOfficialAccount;

import java.util.LinkedList;
import java.util.List;

/**
 * 具体主题类 （微信公众号类）
 * */
public class ConcreteSubject implements Subject{
    List<Observer> observerList = new LinkedList<>();

    @Override
    public void addObserver(Observer observer) {
         observerList.add(observer);
    }

    @Override
    public void notifyMsg(String msg) {
         System.out.println("微信公众号广播消息");
         for (Observer observer : observerList){
             observer.receiveMsg(msg);
         }
    }
}
